<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="jquery-1.8.2.min.js"></script>
    <style>
        div {
            width: 100px;
            height: 100px;
            background-color: yellow;
            float: left;
            border: 1px solid #aaaaaa;
            margin: 0 5px;
        }
        .colored {
            background-color: green;
        }
    </style>
</head>
<body>
    <button id="run">run</button>
    <div></div>
    <div id="mover"></div>
    <div></div>
</body>
<script>
    $(function () {
        $("#run").click(function () {
            $("div:animated").toggleClass("colored");
        })
        function animatedIt() {
            $("#mover").slideToggle("slow", animatedIt);
        }
        animatedIt();
    })
</script>
</html>